package server.lunch;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * @ClassName AppLunch
 * @Description
 * @Author Jingxiao.Ye
 * @Date 2021/12/21 上午1:20
 * @Version V1.0
 * @Since JDK 11
 */
@Component
public class AppLunch implements ApplicationRunner {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        jdbcTemplate.query("select *from t_order",a->{
            System.out.println(a);
        });
        jdbcTemplate.update("INSERT INTO `study`.`t_order`(`id`, `user_id`, `item_id`, `count`, `price_sum`, `price`, `pay_price`, `create_time`, `update_time`, `pay_type`, `order_ip`, `app_id`, `app_version`, `order_no`, `bussiness_id`, `status`, `app_platform`, `device`, `item_name`, `finish_time`) VALUES (1000, 599415, 3488, 6, 209280.00, 34880.00, 0.00, '2021-12-20 02:20:08', '2021-12-20 02:20:08', 0, 'null', 0, 'null', 'WX_1639938008273_1000', '123456', 1, 0, 'null', 'A', '0000-00-00 00:00:00');");
        System.out.println("end");
    }
}
